package www.cskaoyan.com.bean;

import java.util.HashMap;

public class Dormitory {

    private int id;
    private String dormitoryName;
    private String address;


    public Dormitory() {
    }
    public Dormitory(int id, String dormitoryName, String address) {
        this.id = id;
        this.dormitoryName = dormitoryName;
        this.address = address;
    }

    public Dormitory(HashMap parameters) {
        // parameters={address=C8, dormitoryName=1103}
        if (parameters == null){
            return;
        }else {
            try {
                if (parameters.containsKey("id")){
                    id = Integer.parseInt((String) parameters.get("id"));
                }
                if (parameters.containsKey("address")){
                    address = (String) parameters.get("address");
                }
                if (parameters.containsKey("dormitoryName")){
                    dormitoryName = (String) parameters.get("dormitoryName");
                }
            }catch (Exception e){
                System.out.println("前端传递参数转化异常: 参考类型异常");
            }
        }
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getDormitoryName() {
        return dormitoryName;
    }

    public void setDormitoryName(String dormitoryName) {
        this.dormitoryName = dormitoryName;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }
}
